home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MISC.SWG / 0114_Trapping The Debugger 1.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-03  |  868b  |  27 lines

  1. {
  2. [example on how to trap debuggers cut]
  3.  
  4. > The only problem is that people like me just go around this.  Ever tried
  5. > to debug Out of this World?  They tried every trick possible.
  6.  
  7. I find a better way is to do this:
  8.  
  9. Procedure Annoy_Debugger;
  10. Inline($CD/$01);
  11.  
  12. and sprinkle it (VERY!) generously through your code - since it's all inline,
  13. it wont be a separate procedure, and thus cannot be disabled from one
  14. point.... other tricks include (quietly) checking the byte at the address
  15. pointed to by Int 1/3, if the byte contains $CF, then there's no debugger,
  16. else quietly jump to $FFFF:$0000 (reboot address).
  17. Also, this works very well:
  18.  
  19. A_Word:=$01CD;
  20. If A_Word+$1111 <> $12DE Then
  21.   Kick_Some_But;
  22.  
  23. This will detect search&replaces of CD 01.
  24.  
  25. Self-modifying code also works well, and getting the address of Int 1 and
  26. doing a far call....
  27.